package StudyCode.summary.Basic.myrandom;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class UsingRandomDice {
	public static void main(String[] args) {
		int roll;
		String msg = "摇100次骰子:";
		System.out.println(msg);
		for (int i = 0; i < 100; i++) {
			roll = randomInt(1, 6);
			System.out.print(roll + " ");
			if (i % 10 == 9) {
				System.out.println();
			}
		}
		System.out.println();
	}

	private static int randomInt(int low, int high) {
		return (int) (Math.random() * (high - low + 1)) + low;
	}
}
